<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Database\Eloquent\Factories\HasFactory;

/**
 * App\Models\Poster
 *
 * @property int $id
 * @property string|null $type
 * @property string|null $poster
 * @property string|null $brief
 * @property bool $is_disabled
 * @property \Illuminate\Support\Carbon|null $created_at
 * @property \Illuminate\Support\Carbon|null $updated_at
 * @method static Builder|Poster available()
 * @method static \Database\Factories\PosterFactory factory(...$parameters)
 * @method static Builder|Poster newModelQuery()
 * @method static Builder|Poster newQuery()
 * @method static Builder|Poster query()
 * @method static Builder|Poster whereBrief($value)
 * @method static Builder|Poster whereCreatedAt($value)
 * @method static Builder|Poster whereId($value)
 * @method static Builder|Poster whereIsDisabled($value)
 * @method static Builder|Poster wherePoster($value)
 * @method static Builder|Poster whereType($value)
 * @method static Builder|Poster whereUpdatedAt($value)
 * @mixin \Eloquent
 */
class Poster extends Model
{
    use HasFactory;
	
	protected $guarded = ['id'];
	
	protected $casts = [
		'is_disabled' => 'boolean',
	];
	
	public function scopeAvailable(Builder $builder)
	{
		return $builder->where('is_disabled', false);
	}
}
